package com.shop.czlmshop.service;

import com.shop.czlmshop.mapper.ProductMapper;
import com.shop.czlmshop.pojo.Product;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: xmy
 * @Date: 2019-04-29 13:10
 * @Version 1.0
 */
@Service
public class ProductServiceImpl implements ProductService {

    @Resource
    private ProductMapper productMapper;


    /**
     * @description: 查询人气销量商品
     * @param:
     * @return: List<Product>
     * @auther: XMY
     * @date: 2019-05-05 10:30
     */
    @Override
    public List<Product> selProductOrderBySales() {
        return productMapper.selProductOrderBySales();
    }

    /**
     * @description: 查询新品首发的商品
     * @param:
     * @return:
     * @auther: XMY
     * @date: 2019-05-05 13:38
     */
    @Override
    public List<Product> selProductByTime() {
        return productMapper.selProductByTime();
    }

    /**
     * @description: 查询今日折扣的商品
     * @param:
     * @return:
     * @auther: XMY
     * @date: 2019-05-05 13:40
     */
    @Override
    public List<Product> selProductByDiscount() {
        return productMapper.selProductByDiscount();
    }

    /**
     * @description: 查询推荐商品
     * @param:
     * @return:
     * @auther: XMY
     * @date: 2019-05-05 15:42
     */
    @Override
    public List<Product> selRecommendProduct() {
        return productMapper.selRecommendProduct();
    }

    /**
     * @param categoryId
     * @description: 查询该分类下的商品列表
     * @param: categoryId 分类id
     * @return: List<Product>
     * @auther: XMY
     * @date: 2019-05-06 10:27
     */
    @Override
    public List<Product> selCategoryList(Integer categoryId) {
        return productMapper.selCategoryList(categoryId);
    }
}
